# 定义函数，读取json文件中的数据，转化成[(),(),()]格式数据返回
import json
from config import BASE_PATH
def read_json_data(file_name):
    # filename = r"D:\pythonProject1\bj52_apiAutoTestFramework\data\login.json"
    # 打开json文件
    with open(file_name,"r",encoding="utf8") as f:
        # 读取接送文件内容
        json_data = json.load(f)
        # 打印json数据
        # print(json_data)
        data_list = []
        for login_data in json_data:
            val = login_data.values()
        # 将val值，转化为元组
            tup = tuple(val)
            # print(tup)
            data_list.append(tup)
        return data_list

if __name__ == "__main__":
    filename = BASE_PATH+"/data/add_emp.json"
    ret = read_json_data(filename)
    print(ret)

